Skip to content

IDE links: libraries by URL; note for long links - #26

Merged
cedricvogel-leo merged 1 commit into
mainfrom
feature/link-libraries
Oct 30, 2026
Merged

cedricvogel-leo merged 1 commit into
mainfrom
feature/link-libraries

Conversation

@cedricvogel-leo

Copy link
Copy Markdown
Collaborator

P25 decisions 3 and 5, macro side.

Merge only after glpython-edu/glpython-edu.github.io#29 has deployed. An IDE before that PR can't read links of version 2. Until both are live, a block with a library would give a link the IDE can't open (with #28/#29 merged, it shows the «unvollständig oder beschädigt» notice; before them, the IDE shows its stored project).

Changes

  • «IDE-Link kopieren» / «In IDE öffnen»: the block's libraries go into the link by URL, {"path": "parser.py", "url": "…", "readOnly": true} (link version 2), not as code.
    • The IDE fetches them, read-only.
    • They're taken from the block's options, so this works even if fetching failed here.
    • A block file with a library's name replaces it.
    • Blocks without libraries keep version 1 links.
  • Long links: a copied link longer than 2,083 characters is still copied, and a note appears below the buttons (info colours: --glp-info, --glp-info-bg, with fallback values). It's hidden again when a shorter link is copied.
  • README «IDE-Link kopieren» section.

Wording (your version)

  • de: «Dieser Link ist sehr lang (4351 Zeichen). Manche Programme, z. B. OneNote, kürzen solche Links. Für eine Abgabe «In IDE öffnen» wählen und das Projekt dort herunterladen.»
  • en: «This link is very long (4351 characters). Some programs, e.g. OneNote, shorten such links. For a hand-in, choose «Open in IDE» and download the project there.»

Tested in LiaScript

Hosted player in Chrome. This macro served locally, parser.py as a local library URL. The IDE link pointed at the IDE built from #29 (vite preview).

  • Etappe 4 block (python auswerter.py + parser.py by URL):
    • The link has 1,213 characters, v2; parser.py by URL, auswerter.py with its code. No note.
    • The IDE opens it with tabs auswerter.py and parser.py (fetched); «Tests» gives 11 von 11.
  • Long block (about 6,000 characters of code): 4,351 characters, copied, with the note.

check-macro passes.

🤖 Generated with Claude Code

«IDE-Link kopieren» and «In IDE öffnen» name the block's libraries by
their URL (the IDE's link version 2) instead of carrying their code, so an
Etappe 4 block with parser.py gives a link of about 1,200 characters
instead of 5,000+. The IDE fetches them, read-only. A block file with a
library's name replaces it. Links without libraries stay version 1.

A copied link longer than 2,083 characters (OneNote cuts links there) is
still copied, with a note below the buttons: «Dieser Link ist sehr lang
(… Zeichen). Manche Programme, z. B. OneNote, kürzen solche Links. Für eine
Abgabe «In IDE öffnen» wählen und das Projekt dort herunterladen.»

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cedricvogel-leo
cedricvogel-leo merged commit 84c02b5 into main Oct 30, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant